home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 September / 1985-09.d64 / friendly alien (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  170 lines

  1. 5 rem*c64friendlyalien
  2. 6 goto20
  3. 7 print"time: ";mid$(ti$,3,2);":";right$(ti$,2)
  4. 8 ifti$>tu$thenprint"time is up!!!    ":fori=1to1500:next:goto1300
  5. 10 return
  6. 11 lo=lo-q2:return
  7. 12 lo=lo-q1:return
  8. 13 lo=lo+p:return
  9. 14 lo=lo+q3:return
  10. 15 lo=lo+q2:return
  11. 16 lo=lo+q1:return
  12. 17 lo=lo-p:return
  13. 18 lo=lo-q3:return
  14. 20 poke56,48:poke52,48:clr
  15. 30 poke53281,1:print"[147]        *****friendly alien*****[146]
  16. 35 [153]"          stopsetting up...."
  17. 36 [151]56334,[194](56334)[175]254:[151]1,[194](1)[175]251
  18. 40 nm[178]12288:[129]i[178]nm[164]nm[170]511:[151]i,[194](i[170]40960):[130]
  19. 42 [129]i[178]0[164]7:[151]nm[170]8[172]59[170]i,[194](53248[170]81[172]8[170]i):[130]:[151]nm[170]8[172]59[170]3,255
  20. 44 [129]i[178]0[164]7:[151]nm[170]8[172]61[170]i,[194](53248[170]8[172]77[170]i):[130]
  21. 48 [151]1,[194](1)[176]4:[151]56334,[194](56334)[176]1:ck[178]0
  22. 50 [129]i[178]nm[170]272[164]nm[170]311:[135]a:ck[178]ck[170]a:[151]i,a:[130]
  23. 58 [129]i[178]nm[170]344[164]nm[170]383:[135]a:ck[178]ck[170]a:[151]i,a:[130]
  24. 68 [129]i[178]0[164]31:[135]a:ck[178]ck[170]a:[151]nm[170]i,a:[130]
  25. 69 [129]i[178]0[164]7:[135]a:ck[178]ck[170]a:[151]nm[170]8[172]60[170]i,a:[130]
  26. 70 [139]ck[178]15391[167]100
  27. 71 [153]"**error in data statements**":[153]"**check lines 8070-8093**":[128]
  28. 100 x[178][187]([171]ti):[151]53280,0:[151]53281,0
  29. 101 [153]"loadguide the little alien with a joystick  in port 2";
  30. 110 [153]" and pick up all the candy.
  31. 135 print:print"then guide him to the phone and then to the spaceship.
  32. 160 [153]:[153]"syslook out for the cans of cola.";
  33. 161 [153]" if he    drinks cola he will have an allergic";
  34. 165 [153]"    reaction and can't be guided.
  35. 168 print:print"[159]if he touches a flu bug, ";
  36. 169 print"or if you run  out of time, he will get the flu and cannot go home.
  37. 170 [153]"list***you have 2 minutes***
  38. 500 print"enter skill level 1-5[146]":poke198,0
  39. 502 geta$:ifa$=""then502
  40. 503 a=val(a$):ifa<1ora>5then500
  41. 505 sc=1024
  42. 510 cm=54272:print"[147]":poke53280,14:poke53281,1:p5=15
  43. 511 o=0:h1=1:h2=32:h3=3:h4=34:h5=35:h6=36:h7=42:h8=61:h9=2:p6=45:p7=46:p8=47
  44. 512 vl=54296:sl=54272:sh=54273:wf=54276:q1=39:q2=40:q3=41:q4=42::p1=56320:p=1
  45. 515 poke53272,(peek(53272)and240)+12:pokesl+5,17:pokesl+6,241
  46. 519 rem: ***build border
  47. 520 forb=sc+q2tosc+80:pokeb,35:pokecm+b,6:next
  48. 525 forb=sc+79tosc+999stepq2:pokeb,35:pokecm+b,6:next
  49. 530 forb=sc+998tosc+960step-1:pokeb,35:pokecm+b,6:next
  50. 535 forb=sc+960tosc+q2step-q2:pokeb,35:pokecm+b,6:next
  51. 600 rem: ***place flubugs
  52. 605 fori=1to9*a
  53. 610 gosub4000
  54. 612 ifpeek(x)=35then610
  55. 620 pokex,42:pokecm+x,3:ifi<=athenf(i)=x:pokex+cm,7
  56. 622 next
  57. 700 rem: ***place cola
  58. 705 fori=1to15*a
  59. 710 gosub4000
  60. 720 ifpeek(x)=35orpeek(x)=42orpeek(x-q2)=36orpeek(x+q2)=36then710
  61. 725 pokex,36:pokecm+x,2:next
  62. 800 rem: ***place candy
  63. 803 c=2:fori=1to20:c=c+1:ifc>7thenc=2
  64. 810 gosub4000
  65. 820 ifpeek(x)<>32orpeek(x+1)<>32orpeek(x-1)<>32orpeek(x+q2)<>32then810
  66. 822 ifpeek(x-q2)<>32then810
  67. 825 pokex,34:pokecm+x,c:next
  68. 830 rp=20:lo=sc+918:ti$="000000":tu$="000159"
  69. 899 rem: ***main loop
  70. 900 ifrp=.then3000
  71. 920 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
  72. 922 gosub7
  73. 930 pokesh,50:pokevl,10:pokewf,17:goto1500
  74. 935 pokewf,16
  75. 1000 aa=p5-(peek(p1)andp5)
  76. 1050 lt=lo:onaagosub11,15,10,17,18,16,10,13,12,14
  77. 1080 pokelt,h2:pokelt+q2,h2
  78. 1099 rem: ***collision checker
  79. 1100 tl=peek(lo):bl=peek(lo+q2)
  80. 1102 iftl=h1ortl=h3ortl=h5orbl=.orbl=h9orbl=h5thenlo=lt:goto900
  81. 1103 iftl=h2andbl=h2then900
  82. 1110 iftl=h7orbl=h7then1300
  83. 1115 iftl=h8orbl=h8then3500
  84. 1120 iftl=h6orbl=h6then1400
  85. 1130 iftl=h4orbl=h4thenrp=rp-1:goto1200
  86. 1135 iftl=p6ortl=p7ortl=p8orbl=p8then3100
  87. 1140 goto900
  88. 1199 rem: ***candy pickup
  89. 1200 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
  90. 1210 pokesh,150:pokewf,33:forl=1to25:next
  91. 1220 pokesh,200:forl=1to25:next:pokewf,32:goto900
  92. 1299 rem: ***flubug collision
  93. 1300 pokelo,37:pokelo+q2,38:pokelo+cm,3:pokelo+cm+q2,3
  94. 1310 pokesl,150:forl=1to5:pokewf,17:pokesh,25:forx=1to30:next:pokewf,16
  95. 1320 pokewf,33:forx=1to50:next:pokesl,0:forx=1to200:next:next:pokewf,32
  96. 1325 goto2000
  97. 1399 rem: ***cola collision (glug-glug)
  98. 1400 pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
  99. 1410 pokesl,150:forl=1to4:pokewf,17:pokesh,25:forx=1to15:next:pokewf,16
  100. 1412 forx=1to25:next:pokesl,0:forx=1to200:next:next
  101. 1415 pokelo,32:pokelo+q2,32:pokelo+cm,1:pokelo+cm+q2,1
  102. 1416 aa=int(rnd(1)*8)+1:goto1050
  103. 1499 rem: ***select & move flubug
  104. 1500 d=int(rnd(p)*a)+p
  105. 1510 lt=lo:lo=f(d):x=int(rnd(p)*8)+p:ft=f(d)
  106. 1515 onxgosub11,12,13,14,15,16,17,18
  107. 1634 f(d)=lo
  108. 1635 lo=lt:ifpeek(f(d))<>h2andpeek(f(d))<>37andpeek(f(d))<>38thenf(d)=ft
  109. 1700 pokeft,h2
  110. 1702 iff(d)=loorf(d)=lo+q2thenpokelo+cm,h3:pokelo+cm+q2,h3:goto1310
  111. 1710 pokef(d),h7:pokef(d)+cm,7:goto935
  112. 2000 pokevl,.:pokesh,.
  113. 2001 print"[147][144]he caught the flu from the flu bug and  can not go home."
  114. 2002 goto2040
  115. 2025 print"[147][144]               you won!!"
  116. 2030 print"           ";mid$(tt$,3,2);" minute ";right$(tt$,2)" seconds
  117. 2035 [153]"             skill level"a
  118. 2040 [153]"            play again?"
  119. 2045 [151]53272,21
  120. 2050 [161]a$:[139]a$[178]""[167]2050
  121. 2055 [139]a$[178]"y"[167][138]100
  122. 2056 [139]a$[179][177]"n"[167]2050
  123. 2060 [153]"load":[128]
  124. 2999 [143]: ***build spacephone
  125. 3000 q[178]sc[170]80:r[178]sc[170]160:[141]6000:[141]7:[151]lo,32:[151]lo[170]q2,32:lo[178]sc[170]918
  126. 3002 [153]"open+,  ":[153]"-.sys/ ":rp[178]20:[137]900
  127. 3099 [143]: ***ring spacephone
  128. 3100 lo[178]sc[170]84:[151]lo,37:[151]lo[170]q2,38:[151]lo[170]cm,4:[151]lo[170]cm[170]q2,4
  129. 3110 [151]wf,17:[129]l[178]1[164]3:[129]m[178]1[164]50:[151]sh,150:[129]n[178]1[164]13:[130]
  130. 3120 [151]sh,0:[130]:[141]7:[129]m[178]1[164]1000:[130]:[141]7:[130]:[151]wf,16
  131. 3399 [143]: ***build spaceship
  132. 3400 q[178]sc[170]200:r[178]sc[170]440:[141]7:[141]6000:[141]7
  133. 3401 [153]"    ":[153]"    "
  134. 3402 lo[178]sc[170]918:[151]lo,37:[151]lo[170]q2,38:[151]lo[170]cm,4:[151]lo[170]cm[170]q2,4
  135. 3406 [141]7:[141]3600:[141]7
  136. 3408 [153]""[166]20)"open;
  137. 3410 gosub7:gosub3600:gosub7
  138. 3425 print""spc(19)"[159]@#b
  139. 3430 [153][166]17)"<<###<<
  140. 3435 printspc(19)"a#c
  141. 3440 [141]7:[141]3600:[141]7
  142. 3450 [153]""[166]18)"open@###b
  143. 3452 printspc(18)"[159]#####
  144. 3460 [153][166]13)"open###############
  145. 3462 printspc(18)"[159]#####
  146. 3470 [153][166]18)"opena###c
  147. 3480 gosub7:gosub3600:gosub7
  148. 3490 t=sc+343:forb=1to3:poket,h8:pokecm+t,h3:t=t+q3:next:pokesc+387,h2
  149. 3492 pokesc+427,h2
  150. 3495 pokevl,0:pokesh,0:rp=20:goto900
  151. 3499 rem: ***put alien on ramp
  152. 3500 tt$=ti$:lo=sc+386:pokelo,37:pokelo+q2,38:pokelo+cm,4:pokelo+cm+q2,4
  153. 3505 forl=1to1500:next
  154. 3510 pokesc+386,32:pokesc+426,32:pokesc+384,32:pokesc+343,32:pokesc+425,32
  155. 3520 forl=1to2000:next:goto2025
  156. 3599 rem: ***spaceship sound
  157. 3600 pokevl,15:pokewf,33:forl=1to3:form=1to255step2:pokesh,m:next:gosub7:next
  158. 3640 pokewf,32:return
  159. 4000 x=int(rnd(1)*740)+sc+3*q2:return
  160. 5999 rem: ***relocate flubugs
  161. 6000 fori=ptoa:iff(i)>qandf(i)<rthenpokef(i),h2:f(i)=f(i)+280
  162. 6022 nexti:gosub7:return
  163. 8070 data,,,24,24,,,,255,255,255,255,255,255,255,255,,,,56,56,56,56,56
  164. 8075 data36,126,126,60,24,24,24,60,126,189,189,189,189,36,66,66
  165. 8080 data,,31,127,127,255,255,255,,,248,240,224,192,128,,254,253,248,240,224
  166. 8085 data192,128,,,,128,64,32,18,9,6,63,33,63,63,43,53,235,63
  167. 8090 data7,31,63,127,127,255,255,255,255,255,255,127,127,63,31,7
  168. 8092 data224,248,252,254,254,255,255,255,255,255,255,254,254,252,248,224
  169. 8093 data,,,255,255,255,,
  170.